<?php


namespace App\Command\Changedata;


use EchoPHP\Console\Command;
use EchoPHP\Facades\Db;

class BatchLock extends Command {
    protected $signature = "changedata:batchLock";
    protected $description = '将线上账号全部锁定(设为离职状态)';

    public function handle() {
        $sql = 'UPDATE User SET islock=?,lockdate=Now(),updatedate=NOW() WHERE (islock<>? OR islock IS NULL) AND userid>?';
        $var = [1, 1, 1];
        $result = Db::connect()->update($sql, $var);
        $this->output->writeln('执行结束，更新' . $result . '条记录');
    }
}